#include "BankDB.h"
#include <iostream>

using namespace std;

int main()
{
	BankDB db;

	db.addAccount(BankAccount{ 100, "Nicholas Solter" });
	db.addAccount(BankAccount{ 121, "Nicholas Solter121" });
	db.addAccount(BankAccount{ 122, "Nicholas Solter122" });
	db.addAccount(BankAccount{ 200, "Scott Kleper" });
	db.addAccount(BankAccount{ 121, "Scott Kleper121" });

	try {
		auto& account{ db.findAccount(121) };
		cout << "Found account 121" << endl;
		account.setClientName("Nicholas A Solter");

		auto& account2{ db.findAccount("Scott Kleper") };
		cout << "Found account of Scott Kleper" << endl;

		auto& account3{ db.findAccount(1000) };
	} catch (const out_of_range& caughtException) {
		cout << "Unable to find account: " << caughtException.what() << endl;
	}
}
